package com.chinasi.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.caland.framework.core.page.Pager;
import com.chinasi.dao.IntegratorBasicDao;
import com.chinasi.model.IntegratorBasic;
import com.chinasi.service.IntegratorBasicService;

@Service
public class IntegratorBasicServiceImpl implements IntegratorBasicService {

	/**
	 * IntegratorBasicDAO
	 */
	@Autowired
	private IntegratorBasicDao IntegratorBasicDao;

	@Override
	public Pager findPageCondition(IntegratorBasic searchBean, int currentPage) {
		Pager pager = new Pager(IntegratorBasicDao.getTotalCount(searchBean),currentPage);
		pager.setData(IntegratorBasicDao.findByCondition(searchBean, pager.getStartRow(), pager.getPageSize()));
		return pager;
	}

	@Override
	public IntegratorBasic findById(String id) {
		return IntegratorBasicDao.findByPK(id, IntegratorBasic.class);
	}
	
	@Override
	public int findTotalCount(){
		return IntegratorBasicDao.getTotalCount(new IntegratorBasic());
	}
	
}
